function selectFrom(lowerValue,upperValue){
   var choices = upperValue - lowerValue + 1;
   return Math.floor(Math.random()*choices+lowerValue);
  }
    //介于1-100之间的1个整数
    var num = selectFrom(1,100);
    //不同的颜色，可能是数组中的任一个字符串
    var colors = ["red","green","blue","yellow","black"];
    var color = colors[selectFrom(0,colors.length-1)];
